﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Kaleta.Network;

namespace StarWarsGame
{
    public class Xwing : DistributableObject
    {
        public float NormalSpeed = 1.0f;

        public Xwing()
        {
            _rotationDistributable = DistributableProperty<Quaternion>.Register("Rotation", this);
            _positionDistributable = DistributableProperty<Vector3>.Register("Position", this);           
            _lastBulletTimeDistributable = DistributableProperty<double>.Register("LastBulletTime", this);
            _moveSpeedDistributable = DistributableProperty<float>.Register("MoveSpeed", this);
            _playerID = DistributableProperty<int>.Register("PlayerID", this);
            _KillCount = DistributableProperty<int>.Register("KillCount", this);
        }


        #region private properties        

        private DistributableProperty<Quaternion> _rotationDistributable;
        private DistributableProperty<Vector3> _positionDistributable;
        private DistributableProperty<double> _lastBulletTimeDistributable;
        private DistributableProperty<float> _moveSpeedDistributable;
        private DistributableProperty<int> _playerID;
        private DistributableProperty<int> _KillCount;

        #endregion

        #region public properties
   
        public Vector3 Position { get; set; }
        public Quaternion Rotation { get; set; }

        public double LastBulletTime { get; set; }
        public float MoveSpeed { get; set; }
        public string PlayerName { get; set; }
        public int PlayerID { get; set; }
        public int KillCount { get; set; }


        public float locMoveSpeed
        {
            get
            {
                return _moveSpeedDistributable.GetValue();
            }
            set
            {
                _moveSpeedDistributable.SetValue(value);
            }
        }
        public double locLastBulletTime
        {
            get
            {
                return _lastBulletTimeDistributable.GetValue();
            }
            set
            {
                _lastBulletTimeDistributable.SetValue(value);
            }
        }
        public Quaternion locRotation
        {
            get
            {
                return _rotationDistributable.GetValue();
            }
            set
            {
                _rotationDistributable.SetValue(value);
            }
        }        
        public Vector3 locPosition
        {
            get
            {
                return _positionDistributable.GetValue();
            }
            set
            {
                _positionDistributable.SetValue(value);
            }
        }
        public int locKillCount
        {
            get
            {
                return _KillCount.GetValue();
            }
            set
            {
                _KillCount.SetValue(value);
            }
        }

        #endregion

    }
}
